#pragma once

#include <gtkmm.h>
#include "ChessMan.hpp"
#include "board.hpp"
#include "game.hpp"
#include "player_vs_player.hpp"
#include "melee.hpp"

class GtkBoard : public Gtk::Grid{
public:
    void create_cheeses(int rows,int columns);//创建棋盘
    void delete_chesses();//清除棋子
    void board_clear(int rows,int columns);//清空棋盘显示
    void bind_game(gomoku::player_vs_player *game);
    void update_point(int rows,int columns);
    ~GtkBoard();
private:
    ChessMan *chessbtn;
    gomoku::player_vs_player *game1;
    gomoku::point chess_position{0,0};
    void chessbtn_clicked(ChessMan *chessbtn1);//将玩家放置棋盘的位置传输给后端
};

void board_msg_box(Gtk::Window &window,const char *msg);//全局函数，相当于MessageBox函数
